1. Field of the Invention
This invention relates to a graphic form shaping apparatus, and more particularly to a graphic form shaping apparatus which shapes a graphic form having symmetry with respect to a line and surrounded by a curved line.
2. Description of the Related Art
Various apparatus and methods have been proposed which recognize, shape and output a graphic form inputted thereto. Japanese Patent Laid-Open Application No. Showa 62-111369 entitled "Symbol Recognition System", which will be hereinafter referred to suitably as prior art 1, proposes a system which automatically reads a design drawing or a like document and recognizes a graphic symbol appearing on the design drawing.
The system of the prior art 1 is shown in block diagram in FIG. 25. Referring to FIG. 25, the system shown includes a recognition processing section 101, a symbol table 102 and a symmetrical conversion section 103. The recognition processing section 101 includes a symmetrical shape discrimination section 111 and a comparison circuit 112.
Operation of the system of the prior art 1 is described with reference to FIG. 25 and FIG. 26 which is a flow chart illustrating a flow of processing of the system of the prior art 1.
A recognition object image inputted is inputted to the recognition processing section 101. The recognition processing section 101 outputs a recognition result 1a as a result of recognition of the inputted graphic form (steps V1 and V2 of FIG. 26). The symmetrical shape discrimination section 111 discriminates whether or not the recognition result 1a is a symmetrical symbol. This discrimination is performed by referring to the symbol table 102 in which classification of symmetrical and asymmetrical symbols is defined (step V3).
Here, if the symbol is not symmetrical, then the recognition result 1a is determined as a recognition result (step V10).
On the other hand, if it is discriminated that the symbol is symmetrical, the symmetrical conversion section 103 performs symmetrical conversion for the inputted image (step V4).
Then, for the image obtained by the symmetrical conversion, recognition processing is performed again by the recognition processing section 101. As a result, a recognition result 2a is obtained (steps V5 and V6).
Thereafter, the recognition result 1a and the recognition result 2a are compared with each other by the comparison circuit 112. If a coincidence output is obtained, then this is determined as a recognition result, but if a coincidence output is not obtained, then it is determined that discrimination is impossible (steps V7 to V9).
As described above, in the system of the prior art 1, data of a graphic form to be used for recognition are prepared in a symbol table and compared with an inputted image. If the inputted image is discriminated as a symmetrical graphic form, then symmetrical conversion is performed for the image and the images before and after the symmetrical conversion are compared with each other. Then, when it is considered that the two images coincide with each other, a result of the comparison with the symbol table is determined as a result of recognition of the graphic form.
Thus, the system of the prior art 1 is disadvantageous in that, since a graphic form to be discriminated as a symmetrical graphic form must be defined in advance in the symbol table 102, if an undefined symmetrical graphic form is inputted, then it cannot be discriminated as a symmetrical graphic form.
Another system is disclosed in Japanese Patent Laid-Open Application No. Showa 63-261481 entitled "Graphic Form Symmetry Recognition System for Graphic Form Recognition Apparatus", which is hereinafter referred to suitably as prior art 2. The system of the prior art 2 recognizes a drawing such as a drawing of a machine or a drawing of a structure drawn based on a simplified drawing method and supplements, from drawn contents of the drawing, dimensions and so forth which are not described on the drawings.
To this end, the system of the prior art 2 is constructed in such a manner as shown in FIG. 27.
Referring to FIG. 27, the system shown includes a graphic form recognition apparatus 201, symmetry candidate line segment extraction means 202, perpendicular line segment setting means 203, calculation means 204 and drawing information setting means 205.
The graphic form recognition apparatus 201 includes a reading processing section 211, an image data storage section 212, a vector processing section 213, a vector classification processing section 214, a symbol recognition processing section 215, a line segment recognition processing section 216, a character recognition processing section 217 and a recognition result storage section 218.
FIG. 28 illustrates a flow of processing of the system shown in FIG. 27.
Referring to FIGS. 27 and 28, in the graphic form recognition apparatus 201, information of a drawing 200 inputted from the reading processing section 211 is stored into the image data storage section 212. The vector processing section 213 performs polygonal line approximation with the image data stored in the image data storage section 212 to convert the image data into vector data and inputs the vector data to the vector classification processing section 214.
The vector classification processing section 214 classifies the vector data into vector data of marks, line segments and characters and supplies the classified vector data to the symbol recognition processing section 215, line segment recognition processing section 216 and character recognition processing section 217, respectively. The line segment recognition processing section 216 classifies the vector data representative of line segments into shape lines, center lines and so forth and stores the classified vector data into the recognition result storage section 218. The symbol recognition processing section 215 and the character recognition processing section 217 identify marks and characters and store them into the recognition result storage section 218, respectively, together with attributes based on results of the identification (step S1 in FIG. 28).
Thereafter, the symmetry candidate line segment extraction means 202 extracts those center lines with regard to which symmetry may possibly be detected from the recognition result storage section 218 and counts the number of those center lines (step W2). Then, the symmetry candidate line segment extraction means 202 checks whether or not there is a shape line which crosses or is isolated around each of the extracted center lines (step W3). If any center line which crosses a shape line or has isolated shapes on the opposite sides thereof is detected, then the symmetry of the shape line or the isolated shapes is discriminated by the perpendicular line segment setting means 203 and the calculation means 204.
FIG. 29 illustrates a method of discriminating symmetry of a shape line which crosses a center line.
Referring also to FIG. 29, the perpendicular line segment setting means 203 draws a perpendicular L2 to a center line b, for example, from an end point P2 of a vector, and the calculation means 204 calculates the distance 12 between the end point P2 and the center line b. Further, the calculation means 204 calculates the distance m2 between a cross point X2 on a vector c which crosses an extension line of the perpendicular L2 and the center line b. Then, the calculation means 204 calculates the difference between the two distances 12 and m2, and if the difference satisfies EQU .vertline.12-m2.vertline.&lt;.DELTA.1/2 (1)
with respect to a fixed threshold value (.DELTA.1/2), then the calculation means 204 performs similar calculation also for the other end points.
Then, if the expression (1) above is satisfied by all end points and the sum total of the differences in distance satisfies EQU .SIGMA..vertline.ln-mn.vertline.&lt;mn (2)
with respect to a fixed threshold value Q, it is determined that the shape line is symmetrical with respect to the center line b.
After symmetry discrimination is performed for all center lines, the drawing information setting means 205 sets omitted drawing information based on part of drawing information described on shape lines having symmetry (step W7).
As described above, in the system of the prior art 2, a center line which is drawn in advance on a drawing to be inputted is used as an axis of symmetry.
Thus, the system of the prior art 2 is disadvantageous in that, since only a center line which is described in a line type which signifies a center line in advance is recognized as an axis of symmetry, a center line must be described on a graphic form to be inputted.